<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
    var url = 'http://localhost:8080/DataValidation/rest/validate/check/1';

    function getTasks() {
        $.getJSON(url, function(data) {
            $.each(data, function(i, item) {
                $('#taskList').append(
                        '<p><a href="#" onclick="getTask(\'' + item.id
                                + '\');">' + item.name + '</a></p>');
            });
        });
    }

    function getTask(id) {
        $.getJSON(url + '/' + id, function(data) {
            $('#singleTask').html(
                    '<p>' + data.notes + ' (Due ' + data.dueDate + ') - '
                            + (data.complete ? 'Complete' : 'Incomplete')
                            + '</p>');
        });
    }

    function checkContent() {

        var val_holder_name = document.getElementById('holder_name').value;
        var val_holder_email = document.getElementById('holder_email').value;
        var val_holder_birthday = document.getElementById('holder_birthday').value;
        var val_holder_phone_area = document.getElementById('holder_phone_area').value;
        var val_holder_phone = document.getElementById('holder_phone').value;
        var val_holder_phone_mobile = document.getElementById('holder_phone_mobile').value;

        $.post(url,{
	    		holder_name:val_holder_name,
	    		holder_email:val_holder_email,
	    		holder_birthday:val_holder_birthday,
	    		holder_phone_area:val_holder_phone_area,
	    		holder_phone:val_holder_phone,
	    		holder_phone_mobile:val_holder_phone_mobile
        		},
        		function(data){
        			if(data.err_msg == undefined)
        				$("#error_msg").html("");
        			else
 	 	      			$("#error_msg").html(data.err_msg);
        		},
        		"json"
        );

    }

</script>
</head>

<body>
	<div style="width:3	00px;height:500px;	">
	<form method="post" enctype="application/x-www-form-urlencoded"
		action="http://localhost:8080/DataValidation/rest/validate/check/1">
		<fieldset>
			<p><input type="hidden" id="check_file" name="check_file" value="check.xml"/></p>
		
			<p><label for="holder_name">holder_name<br />
			<input type="text" id="holder_name" name="holder_name" /></label></p>
			
			<p><label for="holder_email">holder_email<br />
			<input type="text" id="holder_email" name="holder_email" /></label></p>
			
			<p><label for="holder_birthday">holder_birthday<br />
			<input type="text" id="holder_birthday" name="holder_birthday" /></label></p>
	
			<p><label for="holder_phone_area">holder_phone_area<br />
			<input type="text" id="holder_phone_area" name="holder_phone_area" /></label></p>
	
			<p><label for="holder_phone">holder_phone<br />
			<input type="text" id="holder_phone" name="holder_phone" /></label></p>
	
			<p><label for="holder_phone_mobile">holder_phone_mobile<br />
			<input type="text" id="holder_phone_mobile" name="holder_phone_mobile" /></label></p>
			
			<!-- <input type="submit" value="add"/>  -->
			<div id="click area" onclick="checkContent();">check</div>
		</fieldset>
	</form>
	<br>
	<div id="error_msg"></div>
	</div>
</body>
</html>